package dao;

import entity.Book;
import entity.User;
import entity.Record;

import java.sql.SQLException;
import java.util.List;

public interface LendDao {
    //判断用户是否借过书籍
    public boolean userHasLend(String userId,String bookId) throws SQLException;

    //查询所以书籍借阅记录
    public List<Record> queryAllLend() throws SQLException;

    //判断用户是否归还书籍
    public boolean userIsNotReturn(String userId,String bookId) throws SQLException;

    //添加借阅记录
    public boolean addRecord(String userId, String bookId) throws SQLException;

    //删除借阅记录
    public boolean deleteRecord(String userId, String bookId,String borrowDate) throws SQLException;

    //更新还书记录
    public boolean updateRecord(String userId,String bookId) throws SQLException;

    //用户借阅信息查询
    public List<Record> borrowInformation(String userId) throws SQLException;

    //用户借阅信息统计
    public List<Record> borrowCount(String userId) throws SQLException;

    //查询总数据数
    public int getTotalCount(String sql,Object[] params) throws SQLException;

    //查询当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<Record> queryRecordByPage(int currentPage,int pageSize) throws SQLException;

    //根据用户或书籍账号查询当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<Record> queryRecordByPageRequire(int currentPage,int pageSize,Object param) throws SQLException;

    //根据书籍账号查询统计当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<Record> queryCountByPageRequire(int currentPage,int pageSize,Object param) throws SQLException;

    //查询统计当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<Record> queryCountByPage(int currentPage,int pageSize) throws SQLException;

    //查询用户账号当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<Record> queryRecordByUserPage(int currentPage,int pageSize,String userId) throws SQLException ;

    //根据用户和书籍账号查询当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<Record> queryRecordByUserPageRequire(int currentPage,int pageSize,String userId,Object param) throws SQLException;
}
